<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    String userid=request.getParameter("id");

%>
<style type="text/css" >

    table td,th{
        border: 1px solid #000000;padding: 2px;
    }
</style>
<script type="text/javascript">
    $(function() {
        parent.$.messager.progress('close');
          loaddata();
    });

   function loaddata() {
       $.post("${pageContext.request.contextPath}/userController/getInviteDetail", {random: Math.random(), userid:<%=userid%>}, function (rs) {

           var msg = eval("(" + rs + ")");

           var cont = msg;

           var contnet = cont.replace(/\\"/g, "\'");
           var c = eval("(" + contnet + ")");

           var content = "";

           $.each(c.list, function (index, userbean) {
               content += " <tr>";
               content += "<td>" + userbean.inviteuserid + "</td>";
               content += "<td>" + userbean.realscore + "</td>";
               content += "<td>" + userbean.score + "</td>";
               content += "<td>" + userbean.userid + "</td>";
               content += "<td><a href='javascript:deleterecod(\"" + userbean.id + "\");'>删除</a></td>";
               content += "</tr>";
           });


           $("#tbodycontent").html(content);

       });
   }
       function deleterecod(id){
            $.post("${pageContext.request.contextPath}/inviteController/delete",{random:Math.random(),id:id},function(rs){

                var msg=eval("("+rs+")");

                var cont=msg;

                var contnet=cont.replace(/\\"/g, "\'");
                var c=eval("("+contnet+")");
                if(c.msg){
                    loaddata();
                    alert("删除成功！！");
                }else{
                    alert("删除失败！！");
                }

            });
        }

</script>
<script type="text/javascript">

   </script>
<div data-options="region:'center',border:false">
    <table id="dataGrid1">
        <tr>
            <th>被邀请人ID</th>
            <th>真实积分</th>
            <th>总积分</th>
            <th>邀请人ID</th>
            <th>操作</th>
        </tr>
        <tbody id="tbodycontent">

        </tbody>
    </table>
</div>